package com.lh;

import com.lh.dto.AgeDto;
import com.lh.dto.IdDto;
import com.lh.dto.NameDto;
import com.lh.service.DemoService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Consumer {

    public static void main(String[] args) {
        //测试常规服务
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("consumer2.xml");
        context.start();
        System.out.println("consumer start");
        DemoService demoService = context.getBean(DemoService.class);
        System.out.println("consumer");
//            System.out.println(demoService.getPermissions(1L));
//            System.out.println("返回的dto：" + demoService.dto(IdDto.builder(1L)).toString());
//            NameDto nameDto = new NameDto();
//            nameDto.setId(1L);
//            nameDto.setName("rose");
//            NameDto resDto = demoService.name(nameDto);
//            System.out.println("返回的dto id：" + resDto.getId());
//            System.out.println("返回的dto name：" + resDto.getName());

        AgeDto age = demoService.age(AgeDto.id(1L).age(1L));
        System.out.println("返回的dto id ：" + age.getId());
        System.out.println("返回的dto age ：" + age.getAge());
    }


}
